package com.masq.agencija.beans;

import java.util.LinkedList;
import java.util.List;

import java.util.*;

import com.masq.agencija.interfaces.*;
import com.masq.agencija.interfaces.Agent;
import com.masq.agencija.interfaces.Client;
import com.masq.agencija.interfaces.Rent;
import com.masq.agencija.interfaces.Stan;
import com.masq.agencija.service.RentUniqueID;
import com.masq.agencija.service.Rents;

public class RentB implements Rent{

	private String sifra;
	private List<Stan> stanovi;
	private Client klijent;
	private Agent agent;
	
	public String getSifra() {
		return sifra;
	}
	public void setSifra(String sifra) {
		this.sifra = sifra;
	}
	public List<Stan> getStan() {
		return stanovi;
	}
	public void setStan(List<Stan> stanovi) {
		this.stanovi = stanovi;
	}
	public Client getClient() {
		return klijent;
	}
	public void setClient(Client klijent) {
		this.klijent = klijent;
	}
	public Agent getAgent() {
		return agent;
	}
	public void setAgent(Agent agent) {
		this.agent = agent;
	}
	public void executeRentCreation(Client klijent, Agent agent, Stan stan,
			Rents rents) {
		this.setSifra(RentUniqueID.getRentUniqueID());
		this.setClient(klijent);
		this.setAgent(agent);
		List<Stan> l = new LinkedList<Stan>();
		l.add(stan);
		
		this.setStan(l);
				
		klijent.getRent().add(this);
		stan.getRent().add(this);
		klijent.getRent().add(this);
		
		rents.save(this);
		
	}
	
}
